import request from '@/sheep/request';

const BorrowApi = {
  // 查询还款记录
  queryRepayRecords: (data) => {
    return request({
      url: '/relation/money/queryRepayRecords',
      method: 'POST',
      data,
      custom: {
        auth: true
      },
    });
  },
  // 查询还款记录详情
  queryRepayRecordDetail: (data) => {
    return request({
      url: '/relation/money/queryRepayRecordDetail',
      method: 'POST',
      data,
      custom: {
        auth: true
      },
    });
  },
  // 查询借钱记录
  queryBorrowRecords: (data) => {
    return request({
      url: '/relation/money/queryBorrowRecords',
      method: 'POST',
      data,
      custom: {
        auth: true
      },
    });
  },
  // 查询借钱记录详情
  queryBorrowRecordDetail: (data) => {
    return request({
      url: '/relation/money/queryBorrowRecordDetail',
      method: 'POST',
      data,
      custom: {
        auth: true
      },
    });
  },
  // 还款完成
  repayAll: (data) => {
    return request({
      url: '/relation/money/repayAll',
      method: 'POST',
      data,
      custom: {
        auth: true
      },
    });
  },
  
  // 删除还款记录
  deleteRepayRecord: (data) => {
    return request({
      url: '/relation/money/deleteRepayRecord',
      method: 'POST',
      data,
      custom: {
        auth: true,
        successMsg: '删除成功'
      },
    });
  },
  // 删除借钱记录
  deleteBorrowRecord: (data) => {
    return request({
      url: '/relation/money/deleteBorrowRecord',
      method: 'POST',
      data,
      custom: {
        auth: true,
        successMsg: '删除成功'
      },
    });
  },
  // 添加或修改借钱记录
  addOrUpdateBorrowRecord: (data) => {
    return request({
      url: '/relation/money/addOrUpdateBorrowRecord',
      method: 'POST',
      data,
      custom: {
        auth: true,
        successMsg: '设置成功'
      },
    });
  },
  // 新增或修改还款记录
  addOrUpdateRepayRecord: (data) => {
    return request({
      url: '/relation/money/addOrUpdateRepayRecord',
      method: 'POST',
      data,
      custom: {
        auth: true,
        successMsg: '设置成功'
      },
    });
  },

};

export default BorrowApi;
